package czy.demo.config.shiro;

import org.apache.shiro.session.Session;
import org.apache.shiro.session.SessionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/* 默认会话监听器 */
@Component
public class DefaultSessionListener implements SessionListener {

    private static final Logger logger = LoggerFactory.getLogger(DefaultSessionListener.class);

    @Override
    public void onStart(Session session) {
        logger.debug("会话启动："+session.getId()+","+session.getHost());
    }

    @Override
    public void onStop(Session session) {
        logger.debug("会话停止："+session.getId()+","+session.getHost());
    }

    @Override
    public void onExpiration(Session session) {
        logger.debug("会话过期："+session.getId()+","+session.getHost());
    }
}
